//
//  shopView.m
//  mtrGameProject
//
//  Created by darkcl on 11-2-22.
//  Copyright 2011 Memory Leaks. All rights reserved.
//

#import "shopView.h"
#define FLOOR_WIDTH 440
#define SMALL_SHOP 1
#define BIG_SHOP 2
#define FLOOR_HEIGHT 200

@implementation shopView
@synthesize shopTimer;

- (id)initWithID:(int)objIndex forSeq:(float)sequence andType:(int)shopType 
		andMoney:(int)shopMoney andEP:(int)shopEP andClient:(int)shopClient andName:(NSString *)shopName{
	money = shopMoney;
	epValue = shopEP;
	clientValue = shopClient;
	type = shopType;
    self = [super initWithFrame:CGRectMake((FLOOR_WIDTH/16)*objIndex, 0, FLOOR_WIDTH/(8*type), FLOOR_HEIGHT)];
    if (self) {
        // Initialization code.
		currentMoney = 0;
		currentEP = 0;
		currentClient = 0;
		shopTimer = [NSTimer scheduledTimerWithTimeInterval:sequence target:self selector:@selector(updateValue) userInfo:nil repeats:YES];
    }
    return self;
}

-(void) updateValue{
	currentEP += epValue;
	currentMoney += money;
	currentClient += clientValue;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code.
}
*/

- (void)dealloc {
    [super dealloc];
}


@end
